package org.example

import org.apache.spark.sql.Dataset
import org.apache.spark.sql.Row
import org.apache.spark.sql.SparkSession

object yyw {
  def main(args: Array[String]): Unit = {
    // 初始化 SparkSession
    val spark = SparkSession.builder.appName("TopSalaries").master("local[*]").getOrCreate
    val df = spark.read.option("header", "true").csv("C:\\Users\\Administrator\\Desktop\\Employee_salary_first_half.csv")
    val top3Salaries = df.orderBy(df.col("GROSS").desc).limit(3)
    top3Salaries.show()
    spark.stop()
  }


}